Skip to content

[CHAT-523] Always rephrase question for Sonnet 4.5#1079

Merged
davidgisbey merged 1 commit into
mainfrom
523-always-rephrase-question
May 20, 2026
Merged

[CHAT-523] Always rephrase question for Sonnet 4.5#1079
davidgisbey merged 1 commit into
mainfrom
523-always-rephrase-question

Conversation

@davidgisbey
Copy link
Copy Markdown
Contributor

@davidgisbey davidgisbey commented Apr 28, 2026

DO NOT MERGE until sign off from DS. Likely w/c 18/05

Description

We want to update the QuestionRephraser to always rephrase the question, even if it is the users first question.

This updates the QuestionRephraser to do this for all models except Sonnet 4.0 as we don't have updated prompts for that model so it should continue to use the existing implementation.

We've also got a slight change due to always rephrasing, in that we need two user prompts. One for when there is history, and one for when there isn't.

I've added some basic tests to check that the correct user prompt is being used in both situations.

Jira ticket

https://gdsgovukagents.atlassian.net/jira/software/c/projects/CHAT/boards/269?label=Backend_Dev&selectedIssue=CHAT-523

@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch from 5ce9291 to 682935a Compare April 28, 2026 15:03
@govuk-ci govuk-ci temporarily deployed to govuk-chat-523-always-r-9dymdd April 28, 2026 15:04 Inactive
@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch from 682935a to 8c92594 Compare April 28, 2026 15:14
@govuk-ci govuk-ci temporarily deployed to govuk-chat-523-always-r-9dymdd April 28, 2026 15:14 Inactive
@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch from 8c92594 to 75c951c Compare April 29, 2026 14:27
@govuk-ci govuk-ci temporarily deployed to govuk-chat-523-always-r-9dymdd April 29, 2026 14:28 Inactive
@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch 2 times, most recently from 86afd96 to a44f3c6 Compare May 6, 2026 14:30
@davidgisbey davidgisbey changed the title [DO NOT MERGE][CHAT-523] Quick spike to always send question to rephraser [DO NOT MERGE][CHAT-523] Always rephrase question for Sonnet 4.5 May 6, 2026
@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch 2 times, most recently from 8b957fe to e48cff4 Compare May 6, 2026 14:39
@davidgisbey davidgisbey marked this pull request as ready for review May 6, 2026 14:41
@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch from e48cff4 to 61aa1ac Compare May 6, 2026 15:54
Copy link
Copy Markdown
Contributor

@jackbot jackbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@davidgisbey
Copy link
Copy Markdown
Contributor Author

We're going to hold off on this until later next week due to a suspected increase of surge in traffic in the next week.

We want to update the QuestionRephraser to always rephrase the question,
even if it is the users first question.

This updates the QuestionRephraser to do this for all models except
Sonnet 4.0 as we don't have updated prompts for that model so it should
continue to use the existing implementation.

We've also got a slight change due to always rephrasing, in that we need
two user prompts. One for when there is history, and one for when there
isn't.

I've added some basic tests to check that the correct system prompt is
being used in both situations.
@davidgisbey davidgisbey force-pushed the 523-always-rephrase-question branch from 61aa1ac to bdc3493 Compare May 20, 2026 07:50
@davidgisbey davidgisbey changed the title [DO NOT MERGE][CHAT-523] Always rephrase question for Sonnet 4.5 [CHAT-523] Always rephrase question for Sonnet 4.5 May 20, 2026
@davidgisbey davidgisbey merged commit 933e104 into main May 20, 2026
12 checks passed
@davidgisbey davidgisbey deleted the 523-always-rephrase-question branch May 20, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants